From: Owen W. Taylor Date: Wed, 11 Apr 2018 22:06:39 +0000 (-0400) Subject: Don't scan uncompressed_objects_dir if it doesn't exist X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~205^2^2~56 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9199237b01687e1e0842f3926fd01b695014df2b;p=ostree.git Don't scan uncompressed_objects_dir if it doesn't exist A newly created archive-mode repository won't have a uncompressed-objects-cache directory, and uncompressed_objects_dir is -1 to flag that. The special meaning of -1 meaning "cwd" for libglnx means that the current directory was scanned as if it was an objects directory, producing unexpected results, especially if there were any two-letter files/subdirs in the current directory. Closes: #1537 Approved by: jlebon --- diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index 37f832c8..5fd97902 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -1438,7 +1438,8 @@ scan_loose_devino (OstreeRepo *self, return FALSE; } - if (self->mode == OSTREE_REPO_MODE_ARCHIVE) + if (self->mode == OSTREE_REPO_MODE_ARCHIVE && + self->uncompressed_objects_dir_fd != -1) { if (!scan_one_loose_devino (self, self->uncompressed_objects_dir_fd, devino_cache, cancellable, error))